import request from "@/axios/request";
import url from "@/axios/url";
const { mesUrl, adminUrl } = url();

// 导出url
export const exportUrl = `${mesUrl}mesPcMaterialDemand/requirement/export`

// 导出总表
export const exportAllUrl = `${mesUrl}mesPcRecheckOrder/requirement/export`

// 分页查询
export function getList (data = {}) {
  return request({
    url: `${mesUrl}mesPcRecheckOrder`,
    method: "post",
    data,
  });
}
// 分页-采购侧查询
export function getRequirementList (params = {}) {
  return request({
    url: `${mesUrl}mesPcRecheckOrder/requirement`,
    method: "get",
    params,
  });
}
// 详情
export function getInfo (id) {
  return request({
    url: `${mesUrl}mesTmRecheckOrder/info/${id}`,
    method: "get",
  });
}
// 物料状态数据统计
export function getMaterialCount (params = {}) {
  return request({
    url: `${mesUrl}mesPcMaterialDemand/requirement/count`,
    method: "get",
    params
  });
}
/************************** 采购人员侧 ************************/
// 分页查询物料需求列表
export function mesPcMaterialDemandGetList (params = {}) {
  return request({
    url: `${mesUrl}mesPcMaterialDemand/requirement`,
    method: "get",
    params,
  });
}
// 重新询价
export function reinquiryRequest (params) {
  return request({
    url: `${mesUrl}mesPcMaterialDemand/reinquiry`,
    method: "get",
    params
  });
}
// 供应商报价详情
export function getQuoteList (params) {
  return request({
    url: `${mesUrl}mesPcQuotation/requirement/result`,
    method: "get",
    params
  });
}

// 报价详情-添加备注和图片
export function mesPcMaterialDemandUpdate (data = {}) {
  return request({
    url: `${mesUrl}mesPcMaterialDemand/update`,
    method: "put",
    data,
  });
}
// 更新报价：驳回
export function requirementUpdate (data = {}) {
  return request({
    url: `${mesUrl}mesPcQuotation/requirement/update`,
    method: "post",
    data,
  });
}
/**************************  供应商侧 ************************/